﻿using SimpleORMNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = @"Data Source=LUKI-PC\SQLEXPRESS;Initial Catalog=AdventureWorks2012;Integrated Security=True";

            SqlDatabaseReader db = new SqlDatabaseReader(connectionString);

            Console.WriteLine("Start query...");
            var result = db.Get<Person>("SELECT TOP 100000 * FROM [AdventureWorks2012].[Person].[Person]");
            Console.WriteLine("End query...");
            foreach (var r in result)
            {
                Console.WriteLine(String.Format("{0} {1} {2} {3} {4}", r.Imie, r.MiddleName, r.LastName, r.ModifiedDate, r.PersonType));
            }
            Console.ReadKey();
        }
    }
}
